﻿using System;
using System.Collections.Specialized;
using System.Web.Security;
using ProductIntroduction.Models;
using ProductIntroduction.Utils;

namespace ProductIntroduction.Security
{
    public class ProductIntroductionRoleProvider : RoleProvider
    {
        private string _applicationName;
        private DBEntities db = new DBEntities();

        public override void Initialize(string name, NameValueCollection config)
        {
            base.Initialize(name, config);
            this._applicationName = config.Get("applicationName");
        }

        public override string ApplicationName
        {
            get { return _applicationName; }
            set { _applicationName = value; }
        }

        public override string[] GetRolesForUser(string username)
        {
            return new[] { Constant.RoleNameAdministrator };
        }

        #region NotImplemented
        public override void AddUsersToRoles(string[] usernames, string[] roleNames)
        {
            throw new NotImplementedException();
        }

        public override void CreateRole(string roleName)
        {
            throw new NotImplementedException();
        }

        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole)
        {
            throw new NotImplementedException();
        }

        public override string[] FindUsersInRole(string roleName, string usernameToMatch)
        {
            throw new NotImplementedException();
        }

        public override string[] GetAllRoles()
        {
            throw new NotImplementedException();
        }

        public override string[] GetUsersInRole(string roleName)
        {
            throw new NotImplementedException();
        }

        public override bool IsUserInRole(string username, string roleName)
        {
            throw new NotImplementedException();
        }

        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames)
        {
            throw new NotImplementedException();
        }

        public override bool RoleExists(string roleName)
        {
            throw new NotImplementedException();
        } 
        #endregion
    }
}